<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>人员分析</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="../static/bower_components/bootstrap/dist/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../static/bower_components/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="../static/bower_components/Ionicons/css/ionicons.min.css">
    <!-- DataTables -->
    <link rel="stylesheet" href="../static/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="../static/dist/css/skins/_all-skins.min.css">
    <!-- daterange picker -->
    <link rel="stylesheet" href="../static/bower_components/bootstrap-daterangepicker/daterangepicker.css">
    <!-- bootstrap datepicker -->
    <link rel="stylesheet" href="../static/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
    <!-- iCheck for checkboxes and radio inputs -->
    <link rel="stylesheet" href="../static/plugins/iCheck/all.css">
    <!-- Select2 -->
    <link rel="stylesheet" href="../static/bower_components/select2/dist/css/select2.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="../static/dist/css/skins/_all-skins.min.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Google Font -->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <header class="main-header">
        <!-- Logo -->
        <a href="#" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini">物</span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg">物流分析</span>
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>

            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!--导航栏信息，已经删除-->
                </ul>
            </div>
        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- Sidebar user panel -->
            <!-- search form -->
            <!-- /.search form -->
            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu" data-widget="tree">
                <!--<li class="header">MAIN NAVIGATION</li>-->
                <li>
                    <a href="${pageContext.request.contextPath}/shipping/loadInfo">
                        <i class="fa fa-dashboard"></i> <span>站点分析</span>

                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="fa fa-id-badge"></i> <span>人员分析</span>
                    </a>
                </li>
            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                人员分析
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="#">人员分析</a></li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <br/>
                <div class="col-xs-12">
                    <div class="col-md-8">
                        <div class="form-group">
                            <label style="display: block;">站点选择(请输入站点名称)</label>
                            <%--<select id="loadInfoAutocomplete" class="form-control select2" data-placeholder="Select a Start Site"--%>
                            <%--style="width: 100%;">--%>
                            <%--</select>--%>
                            <input type="text" class="span3" id="loadInfoAutocomplete" data-provide="typeahead"
                                   placeholder="自动匹配"/>
                        </div>
                    </div>
                </div>
                <!-- /.col -->
            </div>
            <%--<div class="row">--%>
            <%--<div class="col-xs-12">--%>
            <%--<div class="col-md-12">--%>
            <%--<label>起止日期选择:</label>--%>
            <%--<div class="input-group">--%>
            <%--<button type="button" class="btn btn-default pull-right" id="daterange-btn">--%>
            <%--<span>--%>
            <%--<i class="fa fa-calendar"></i> Date range picker--%>
            <%--</span>--%>
            <%--<i class="fa fa-caret-down"></i>--%>
            <%--</button>--%>
            <%--</div>--%>
            <%--</div>--%>
            <%--</div>--%>
            <%--</div>--%>
            <div class="box-footer">
                <button type="submit" class="btn btn-info pull-right" onclick="getStaff()">确定</button>
            </div>
            <!-- /.box-footer -->
            <br/>
            <div class="row">
                <div class="col-md-12" id="peopleNameArea">
                </div>
            </div>
            <br/>
            <hr/>
            <div class="row">
                <div class="col-md-12">
                    <%--第三张图 工作量分析(按件)(过去24小时)--%>
                    <div id="chart3" style="height: 400px;"></div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <%--第四张图 工作量分析(按重)(过去24小时)--%>
                    <div id="chart4" style="height: 400px;"></div>
                </div>
            </div>
            <br/>
            <hr/>
            <div class="row">
                <div class="col-md-6">
                    <%--第一张图 工作量分析(7天)--%>
                    <div id="chart1" style="height: 400px;"></div>
                </div>
                <div class="col-md-6">
                    <%--第二张图 时效分析(7天)--%>
                    <div id="chart2" style="height: 400px;"></div>
                </div>
            </div>
            <br/>
            <hr/>

            <!-- /.row -->
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <footer class="main-footer">
        <div class="pull-right hidden-xs">
            <b>Version</b> 1.0.0
        </div>
        <strong>Copyright &copy; 2018 <a href="#">上海大学 信息办</a>.</strong> All rights
        reserved.
    </footer>

    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
        <!-- Create the tabs -->
        <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
            <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
            <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
            <!-- Home tab content -->
            <div class="tab-pane" id="control-sidebar-home-tab">
                <h3 class="control-sidebar-heading">Recent Activity</h3>
                <ul class="control-sidebar-menu">
                    <li>
                        <a href="javascript:void(0)">
                            <i class="menu-icon fa fa-birthday-cake bg-red"></i>

                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>

                                <p>Will be 23 on April 24th</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <i class="menu-icon fa fa-user bg-yellow"></i>

                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4>

                                <p>New phone +1(800)555-1234</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <i class="menu-icon fa fa-envelope-o bg-light-blue"></i>

                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4>

                                <p>nora@example.com</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <i class="menu-icon fa fa-file-code-o bg-green"></i>

                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4>

                                <p>Execution time 5 seconds</p>
                            </div>
                        </a>
                    </li>
                </ul>
                <!-- /.control-sidebar-menu -->

                <h3 class="control-sidebar-heading">Tasks Progress</h3>
                <ul class="control-sidebar-menu">
                    <li>
                        <a href="javascript:void(0)">
                            <h4 class="control-sidebar-subheading">
                                Custom Template Design
                                <span class="label label-danger pull-right">70%</span>
                            </h4>

                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <h4 class="control-sidebar-subheading">
                                Update Resume
                                <span class="label label-success pull-right">95%</span>
                            </h4>

                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-success" style="width: 95%"></div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <h4 class="control-sidebar-subheading">
                                Laravel Integration
                                <span class="label label-warning pull-right">50%</span>
                            </h4>

                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-warning" style="width: 50%"></div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <h4 class="control-sidebar-subheading">
                                Back End Framework
                                <span class="label label-primary pull-right">68%</span>
                            </h4>

                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-primary" style="width: 68%"></div>
                            </div>
                        </a>
                    </li>
                </ul>
                <!-- /.control-sidebar-menu -->

            </div>
            <!-- /.tab-pane -->
            <!-- Stats tab content -->
            <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>
            <!-- /.tab-pane -->
            <!-- Settings tab content -->
            <div class="tab-pane" id="control-sidebar-settings-tab">
                <form method="post">
                    <h3 class="control-sidebar-heading">General Settings</h3>

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Report panel usage
                            <input type="checkbox" class="pull-right" checked>
                        </label>

                        <p>
                            Some information about this general settings option
                        </p>
                    </div>
                    <!-- /.form-group -->

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Allow mail redirect
                            <input type="checkbox" class="pull-right" checked>
                        </label>

                        <p>
                            Other sets of options are available
                        </p>
                    </div>
                    <!-- /.form-group -->

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Expose author name in posts
                            <input type="checkbox" class="pull-right" checked>
                        </label>

                        <p>
                            Allow the user to show his name in blog posts
                        </p>
                    </div>
                    <!-- /.form-group -->

                    <h3 class="control-sidebar-heading">Chat Settings</h3>

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Show me as online
                            <input type="checkbox" class="pull-right" checked>
                        </label>
                    </div>
                    <!-- /.form-group -->

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Turn off notifications
                            <input type="checkbox" class="pull-right">
                        </label>
                    </div>
                    <!-- /.form-group -->

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Delete chat history
                            <a href="javascript:void(0)" class="text-red pull-right"><i class="fa fa-trash-o"></i></a>
                        </label>
                    </div>
                    <!-- /.form-group -->
                </form>
            </div>
            <!-- /.tab-pane -->
        </div>
    </aside>
    <!-- /.control-sidebar -->
    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 3 -->
<script src="../static/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="../static/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- DataTables -->
<script src="../static/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="../static/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="../static/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="../static/bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="../static/dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../static/dist/js/demo.js"></script>
<!-- page script -->
<!-- Select2 -->
<script src="../static/bower_components/select2/dist/js/select2.full.min.js"></script>
<!-- InputMask -->
<script src="../static/plugins/input-mask/jquery.inputmask.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<!-- date-range-picker -->
<script src="../static/bower_components/moment/min/moment.min.js"></script>
<script src="../static/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
<!-- bootstrap datepicker -->
<script src="../static/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<!-- bootstrap color picker -->
<script src="../static/bower_components/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
<!-- bootstrap time picker -->
<script src="../static/plugins/timepicker/bootstrap-timepicker.min.js"></script>
<!-- iCheck 1.0.1 -->
<script src="../static/plugins/iCheck/icheck.min.js"></script>
<!-- ChartJS -->
<script src="../static/bower_components/chart.js/Chart.js"></script>

<!--echarts插件加载-->
<script src="../static/plugins/echarts/echarts.js"></script>
<%--文本自动填充--%>
<script src="../static/plugins/bootstrap-typeahead/typeahead_bootstrap3.js"></script>
<%--autocomplete--%>
<script>
    // loadInfoAutocomplete

    // getLocalFile();
    $(document).ready(function () {
        $.getJSON("../static/data/siteNamesArr.json", function (result) {
            $.each(result, function (i, field) {
                // console.log('fileld', i, field);
                // var parent = document.getElementById('loadInfoAutocomplete');
                $('#loadInfoAutocomplete').typeahead({source: field})
            });
        });
    });

</script>
<%--自动生成按钮，显示人员--%>
<%--peopleNameArea--%>
<%--<button type="button" class="btn btn-block btn-default">Default</button>--%>
<script>

    //自动生成近七天的员工列表
    function getStaff() {
        $("div").remove(".col-md-1");
        $.ajax({
                type: "post",
                async: true,
                url: '${pageContext.request.contextPath}/shipping/peopleSumInfo/getStaff',
                dataType: "json",
                data: {
                    "location": $("#loadInfoAutocomplete").text().trim(),
                },
                success: function (json) {
                    var staff = [];
                    for (var i = 0; i < json.length; i++) {
                        staff.push(json[i].scanMan);
                    }
                    autoCompleteStaff(staff);
                },
                error: function (errorMsg) {
                    console.log("从后台加载图表数据失败");
                }
            }
        )


    }

    function autoCompleteStaff(staff) {
        const peopleNameArea = document.getElementById('peopleNameArea');
        for (var i = 0; i < staff.length; i += 1) {
            const peopleDiv = document.createElement('div');
            peopleDiv.setAttribute('class', 'col-md-1');
            const peopleBtn = document.createElement('button');
            peopleBtn.setAttribute('type', 'button');
            peopleBtn.setAttribute('class', 'btn btn-block btn-success');
            peopleBtn.setAttribute('id', staff[i].toString());
            // 悬浮显示信息
            peopleBtn.setAttribute('title', staff[i].toString());
            const peopleSpan = document.createElement('span');
            peopleSpan.setAttribute('class', 'fa fa-id-badge');
            peopleBtn.appendChild(peopleSpan);
            // 在下面修改
            peopleBtn.onclick = function () {
                //alert('我是第'+ this.getAttribute('title') +'号员工');
                showChartById(this.getAttribute('title'));
            };
            peopleDiv.appendChild(peopleBtn);
            peopleNameArea.appendChild(peopleDiv);
        }
    }

    function showChartById(staffId) {
        showChart12(staffId);
        showChart34(staffId);
    }

    function showChart12(staffId) {
        myChart1.showLoading();
        myChart2.showLoading();
        $.ajax({
                type: "post",
                async: true,
                url: '${pageContext.request.contextPath}/shipping/peopleSumInfo/getChart12',
                dataType: "json",
                data: {
                    "location": $("#loadInfoAutocomplete").text().trim(),
                    "name": staffId.toString().trim()
                },
                success: function (json) {
                    myChart1.hideLoading();
                    myChart2.hideLoading();
                    var dates = [];
                    var lw = [];
                    var ln = [];
                    var uw = [];
                    var un = [];
                    var sw = [];
                    var sn = [];
                    var lwh = [];
                    var lnh = [];
                    var uwh = [];
                    var unh = [];
                    var swh = [];
                    var snh = [];
                    for (var i = 0; i < json.length; i++) {
                        dates.push(json[i].date);
                        lw.push(Math.round(json[i].loadWeight));
                        ln.push(json[i].loadNum);
                        uw.push(Math.round(json[i].unloadWeight));
                        un.push(json[i].unloadNum);
                        sw.push(Math.round(json[i].sortWeight));
                        sn.push(json[i].sortNum);
                        lwh.push(Math.round(json[i].loadWeight / 24));
                        lnh.push(json[i].loadNum / 24);
                        uwh.push(Math.round(json[i].unloadWeight / 24));
                        unh.push(json[i].unloadNum / 24);
                        swh.push(Math.round(json[i].sortWeight / 24));
                        snh.push(json[i].sortNum / 24);
                    }
                    drawChart12(myChart1, dates, lw, ln, uw, un, sw, sn);
                    drawChart12(myChart2, dates, lwh, lnh, uwh, unh, swh, snh);
                },
                error: function (errorMsg) {
                    console.log("从后台加载图表数据失败");
                }
            }
        )
    }

    function showChart34(staffId) {
        myChart3.showLoading();
        myChart4.showLoading();
        $.ajax({
                type: "post",
                async: true,
                url: '${pageContext.request.contextPath}/shipping/peopleSumInfo/getChart34',
                dataType: "json",
                data: {
                    "location": $("#loadInfoAutocomplete").text().trim(),
                    "name": staffId.toString().trim()
                },
                success: function (json) {
                    myChart3.hideLoading();
                    myChart4.hideLoading();
                    var dates = [];
                    var lw = [];
                    var ln = [];
                    for (var i = 0; i < json.length; i++) {
                        dates.push(json[i].date.split(" ")[1]);
                        lw.push(Math.round(json[i].loadWeight));
                        ln.push(json[i].loadNum);
                    }
                    drawChart34(myChart3, dates, ln);
                    drawChart34(myChart4, dates, lw);
                },
                error: function (errorMsg) {
                    console.log("从后台加载图表数据失败");
                }
            }
        )
    }

    function drawChart12(chart, date, lw, ln, uw, un, sw, sn) {
        option = {
            xAxis: [
                {
                    data: date
                }
            ],
            series: [
                {
                    data: ln
                },
                {
                    data: un,
                    yAxisIndex: 1
                },
                {
                    data: sn
                },
                {
                    data: lw,
                    yAxisIndex: 1
                },
                {
                    data: uw
                },
                {
                    data: sw,
                    yAxisIndex: 1
                },
            ]
        }

        chart.setOption(option);
    }

    function drawChart34(chart, date, data) {
        option = {
            xAxis: [
                {
                    data: date,
                }
            ],
            series: [
                {
                    data: data
                }
            ]
        };

        chart.setOption(option);
    }


</script>

<%--echarts插件，自定义脚本--%>
<script>
    // 第一幅图 工作量分析(过去7天)
    option1 = {
        title: {
            text: '工作量分析（过去7天）',
            left: 'center',
            textStyle: {                 //---主标题内容样式
                color: '#000000'
            }
        },
        color: ['#003366', '#4cabce', '#006699', '#e5323e', '#7e7fe4', '#002255'],
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        legend: {
            data: ['装车件数', '卸车件数', '分拣件数', '装车重量', '卸车重量', '分拣重量'],
            x: 'center', // 'center' | 'left' | {number},
            y: 'bottom', // 'center' | 'bottom' | {number}
        },
        calculable: true,
        xAxis: [
            {
                type: 'category',
                axisTick: {show: false},
                data: ['2018/11/1', '2018/11/2', '2018/11/3', '2018/11/4']
            }
        ],
        yAxis: [
            {
                name: '件数',
                type: 'value',
            }, {
                name: '重量',
                type: 'value',
            }
        ],
        series: [
            {
                name: '装车件数',
                type: 'bar',
                barWidth: 30,
                barGap: 0,
                data: [320, 332, 301, 334]
            },
            {
                name: '卸车件数',
                type: 'bar',
                barWidth: 30,
                data: [220, 182, 191, 234],
                yAxisIndex: 1
            },
            {
                name: '分拣件数',
                type: 'bar',
                barWidth: 30,
                barGap: 0,
                data: [320, 332, 301, 334]
            },
            {
                name: '装车重量',
                type: 'line',
                data: [220, 182, 191, 234],
                yAxisIndex: 1
            },
            {
                name: '卸车重量',
                type: 'line',
                barGap: 0,
                data: [320, 332, 301, 334]
            },
            {
                name: '分拣重量',
                type: 'line',
                data: [220, 182, 191, 234],
                yAxisIndex: 1
            },
        ]
    }

    // 基于准备好的dom，初始化echarts实例

    var myChart1 = echarts.init(document.getElementById('chart1'));

    // 使用刚指定的配置项和数据显示图表。

    myChart1.setOption(option1);

    // 第二幅图 工作实效分析
    option2 = {
        title: {
            text: '工作实效分析（过去7天）',
            left: 'center',
            textStyle: {                 //---主标题内容样式
                color: '#000000'
            }
        },
        color: ['#003366', '#4cabce', '#006699', '#e5323e', '#7e7fe4', '#002255'],
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        legend: {
            data: ['装车件数', '卸车件数', '分拣件数', '装车重量', '卸车重量', '分拣重量'],
            x: 'center', // 'center' | 'left' | {number},
            y: 'bottom', // 'center' | 'bottom' | {number}
        },
        calculable: true,
        xAxis: [
            {
                type: 'category',
                axisTick: {show: false},
                data: ['2018/11/1', '2018/11/2', '2018/11/3', '2018/11/4']
            }
        ],
        yAxis: [
            {
                name: '件数',
                type: 'value',
            }, {
                name: '重量',
                type: 'value',
            }
        ],
        series: [
            {
                name: '装车件数',
                type: 'bar',
                barWidth: 30,
                barGap: 0,
                data: [320, 332, 301, 334]
            },
            {
                name: '卸车件数',
                type: 'bar',
                barWidth: 30,
                data: [220, 182, 191, 234],
                yAxisIndex: 1
            },
            {
                name: '分拣件数',
                type: 'bar',
                barWidth: 30,
                barGap: 0,
                data: [320, 332, 301, 334]
            },
            {
                name: '装车重量',
                type: 'line',
                data: [220, 182, 191, 234],
                yAxisIndex: 1
            },
            {
                name: '卸车重量',
                type: 'line',
                barGap: 0,
                data: [320, 332, 301, 334]
            },
            {
                name: '分拣重量',
                type: 'line',
                data: [220, 182, 191, 234],
                yAxisIndex: 1
            },
        ]
    }

    // 基于准备好的dom，初始化echarts实例

    var myChart2 = echarts.init(document.getElementById('chart2'));

    // 使用刚指定的配置项和数据显示图表。

    myChart2.setOption(option2);


    // 第三幅图 员工件数时效分析
    option3 = {
        title: {
            text: '工作量分析(按件)（过去24小时）',
            left: 'center',
            textStyle: {                 //---主标题内容样式
                color: '#000000'
            }
        },
        color: ['#3398DB'],
        tooltip: {
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'line'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [
            {
                name: '时间',
                type: 'category',
                data: ['8h', '9h', '10h', '11h', '12h'],
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis: [
            {
                name: '件/时',
                type: 'value'
            }
        ],
        series: [
            {
                name: '件/时',
                type: 'line',
                data: [10, 52, 200, 334, 390]
            }
        ]
    };

    // 基于准备好的dom，初始化echarts实例

    var myChart3 = echarts.init(document.getElementById('chart3'));

    // 使用刚指定的配置项和数据显示图表。

    myChart3.setOption(option3);

    // 第二幅图 员工重量时效分析
    option4 = {
        title: {
            text: '工作量分析(按重)(过去24小时)',
            left: 'center',
            textStyle: {                 //---主标题内容样式
                color: '#000000'
            }
        },
        color: ['#3398DB'],
        tooltip: {
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'line'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [
            {
                name: '时间',
                type: 'category',
                data: ['8h', '9h', '10h', '11h', '12h'],
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis: [
            {
                name: 'kg/时',
                type: 'value'
            }
        ],
        series: [
            {
                name: 'kg/时',
                type: 'line',
                data: [10, 52, 200, 334, 390]
            }
        ]
    };

    // 基于准备好的dom，初始化echarts实例

    var myChart4 = echarts.init(document.getElementById('chart4'));

    // 使用刚指定的配置项和数据显示图表。

    myChart4.setOption(option4);

</script>
<!-- Page script -->
<script>
    $(function () {
        //Initialize Select2 Elements
        $('.select2').select2()

        //Datemask dd/mm/yyyy
        $('#datemask').inputmask('dd/mm/yyyy', {'placeholder': 'dd/mm/yyyy'})
        //Datemask2 mm/dd/yyyy
        $('#datemask2').inputmask('mm/dd/yyyy', {'placeholder': 'mm/dd/yyyy'})
        //Money Euro
        $('[data-mask]').inputmask()

        //Date range picker
        $('#reservation').daterangepicker()
        //Date range picker with time picker
        $('#reservationtime').daterangepicker({timePicker: true, timePickerIncrement: 30, format: 'MM/DD/YYYY h:mm A'})
        //Date range as a button
        $('#daterange-btn').daterangepicker(
            {
                ranges: {
                    'Today': [moment(), moment()],
                    'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                    'Last 7 Days': [moment().subtract(6, 'days'), moment()],
                    'Last 30 Days': [moment().subtract(29, 'days'), moment()],
                    'This Month': [moment().startOf('month'), moment().endOf('month')],
                    'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
                },
                startDate: moment().subtract(29, 'days'),
                endDate: moment()
            },
            function (start, end) {
                $('#daterange-btn span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'))
            }
        )

        //Date picker
        $('#datepicker').datepicker({
            autoclose: true
        })

        //iCheck for checkbox and radio inputs
        $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
            checkboxClass: 'icheckbox_minimal-blue',
            radioClass: 'iradio_minimal-blue'
        })
        //Red color scheme for iCheck
        $('input[type="checkbox"].minimal-red, input[type="radio"].minimal-red').iCheck({
            checkboxClass: 'icheckbox_minimal-red',
            radioClass: 'iradio_minimal-red'
        })
        //Flat red color scheme for iCheck
        $('input[type="checkbox"].flat-red, input[type="radio"].flat-red').iCheck({
            checkboxClass: 'icheckbox_flat-green',
            radioClass: 'iradio_flat-green'
        })

        //Colorpicker
        $('.my-colorpicker1').colorpicker()
        //color picker with addon
        $('.my-colorpicker2').colorpicker()

        //Timepicker
        $('.timepicker').timepicker({
            showInputs: false
        })
    })
</script>

<script>
    $(function () {
        $('#example1').DataTable()
        $('#example2').DataTable({
            'paging': true,
            'lengthChange': false,
            'searching': false,
            'ordering': true,
            'info': true,
            'autoWidth': false
        })
    })
</script>
</body>
</html>
